import "babel-polyfill";

import ReactDOM from 'react-dom';
import React from 'react';

import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger'
import { Provider } from 'react-redux';
import reducer from './reducers/reducer.js';

import MyRouter from './router/MyRouter.jsx';


import 'antd/dist/antd.css';
import './sass/main.scss';

const loggerMiddleware = createLogger()

let store = createStore(
  reducer,
  window.devToolsExtension && window.devToolsExtension(),  //redux  浏览器插件
    applyMiddleware(  //redux中间件
    thunk,   //允许action 返回function  并运行function  function内可以调用dispatch 用于异步加载  链接服务器用
    loggerMiddleware  //在控制台打印 action
  )
)

ReactDOM.render(
  <Provider store={store}>
    <MyRouter/>
  </Provider>
  ,
  document.getElementById('root')
);


